home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / create_prey.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  2.7 KB  |  109 lines  |  [TEXT/MPCC]

  1.  
  2.             /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
  3.             /*                                                               */
  4.             /*                    Prototype HP15C Calculator                */
  5.             /*                    James C. Ullrey                            */
  6.             /*                    INRESCO                                    */
  7.             /*                    © 1990                                    */
  8.             /*                    Version    13.97a                            */
  9.             /*                                                               */
  10.             /*                    PREY SEGMENT                               */
  11.             /*                                                               */
  12.             /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
  13.  
  14.  
  15. /*****************************************************************/
  16. /*  I N C L U D E S
  17. /*****************************************************************/
  18. #ifndef __C14__
  19. #include    "PredatorPrey.h"
  20. #endif
  21. #include    "create_prey.h"
  22. #include "calc_dork.h"
  23. #include "calc_contents.h"
  24. #ifndef __CIN__
  25. #include    "calc_inits.h"
  26. #endif
  27. /********************************************************************/
  28. /*  G L O B A L   V A R I A B L E   D E C L A R A T I O N S
  29. /********************************************************************/
  30. extern    WindowPtr    preyPtr;
  31. extern    WindowPtr    lastPtr;
  32.  
  33. /*****************************************************************/
  34. /*  P R O T O T Y P E S
  35. /*****************************************************************/
  36.  
  37. void    CreatePrey(void);
  38. void    GetPreyBkgrnd(WindowPtr);
  39.  
  40. /*****************************************************************/
  41. /*****************************************************************/
  42. /*                                                                 */
  43. /* R O U T I N E S                                                 */
  44. /*                                                                 */
  45. /*****************************************************************/
  46. /*****************************************************************/
  47.  
  48.  
  49. void    prey_seg() {}        /*  for reference in "UnloadSeg()" calls    */
  50.  
  51. void    GetPreyBkgrnd(WindowPtr    wPtr)
  52. {
  53.     Point     mouse_pt;
  54.     short    type,k;
  55.     WObjsHandle        w_objs_hndl;
  56.     
  57.     //mouse_pt = an_event->where;
  58.     w_objs_hndl = (WObjsHandle)GetWRefCon(wPtr);
  59.     if((**w_objs_hndl).hasBackGround == TRUE)
  60.     {
  61.         if((**w_objs_hndl).hasTargets)
  62.             type = T_BACKGRND_OBJ;
  63.         else
  64.             type = BACKGRND_OBJ;
  65.         create_new_object(wPtr,mouse_pt,type);
  66.         //if((**w_objs_hndl).isPrey)
  67.         //{
  68.         /*for(k = 0;k<6;k++)*/
  69. /*        {*/
  70. /*            Do_Plane_Control(wPtr,0,30,0,FALSE);    /*    rotate    »*/
  71. /*        }*/
  72. /*        Do_Translation(wPtr,0,0,-200,FALSE);/*    back off    »*/
  73.         //}
  74.     }
  75.     type = BARBIE;                                //(**w_objs_hndl).paletteSetting;
  76.     create_new_object(wPtr,mouse_pt,type);    /*    calc_contents.c    */
  77.     ;
  78. }
  79.  
  80. /************************** CreatePrey ***************************/
  81.  
  82. void    CreatePrey(void)
  83. {
  84.     WindowPtr        wPtr;
  85.     
  86.     if(lastPtr != NIL)
  87.     {
  88.         if((wPtr = get_window(3)) != NIL)    /*    get_window() ; in calc_inits.c    */
  89.         {
  90.             ShowWindow(wPtr);
  91.             SelectWindow(wPtr);
  92.             preyPtr = wPtr;
  93.             GetPreyBkgrnd(preyPtr);
  94.         }
  95.     }
  96. }
  97.  
  98. /*********************** end of CreatePrey ***********************/
  99.  
  100. void DoPreyMenu(short    theItem)
  101. {
  102.     switch(theItem)
  103.     {
  104.         case    1:
  105.                     CreatePrey();
  106.                     break;
  107.     }
  108. }
  109.